package com.etc.controller;

import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.etc.entity.AsCollection;
import com.etc.service.IAsCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;

import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 专辑管理Controller
 * 
 * @author ruoyi
 * @date 2022-11-27
 */
@RestController
@RequestMapping("/collection")
public class AsCollectionController
{
    @Autowired
    private IAsCollectionService asCollectionService;

    /**
     * 查询专辑管理列表
     */

    @GetMapping("/list")
    public List list(AsCollection asCollection)
    {
        List<AsCollection> list = asCollectionService.selectAsCollectionList(asCollection);
        return list;
    }

    /**
     * 导出专辑管理列表
     */


    @PostMapping("/export")
    public void export(HttpServletResponse response, AsCollection asCollection) throws IOException {
        List<AsCollection> list = asCollectionService.selectAsCollectionList(asCollection);
        ExcelUtil<AsCollection> util = new ExcelUtil<AsCollection>(AsCollection.class);
        util.exportExcel(response, list, "专辑管理数据");
    }

    /**
     * 获取专辑管理详细信息
     */

    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(asCollectionService.selectAsCollectionById(id));
    }

    /**
     * 新增专辑管理
     */


    @PostMapping
    public AjaxResult add(@RequestBody AsCollection asCollection)
    {
        return AjaxResult.success();
    }

    /**
     * 修改专辑管理
     */


    @PutMapping
    public AjaxResult edit(@RequestBody AsCollection asCollection)
    {
        return AjaxResult.success();
    }

    /**
     * 删除专辑管理
     */


	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return AjaxResult.success();
    }
}
